/*
#include <QtGui>
#include <QPushButton>
#include <QMessageBox>
#include <QTextEdit>
#include <QSystemTrayIcon>
*/

#include <QFile>
#include <QIODevice>
#include <QDebug>


#include <QApplication>

#include <iostream>
using namespace std;

#include "qxtglobalshortcut.h"
#include "myglobalshortcuts.h"

myGlobalShortcuts::myGlobalShortcuts()
{

  


  //global hot key
  QxtGlobalShortcut *sc = new QxtGlobalShortcut(QKeySequence("Alt+Shift+I"));
  connect(sc, SIGNAL(activated()), this, SLOT(testShortcuts()));


  //QFile *file = new QFile;
  //file->open(stdin, QIODevice::ReadOnly);
  //qWarning() << "read : " << file->readLine(1024);	//read available, but blocked !
  //connect(file, SIGNAL(readyRead()), this, SLOT(test2()));
  //file.readLine();
  //file.close();

  //  QFile f;
  //  f.open(stdout, QIODevice::WriteOnly);
  //  f.write("hello");
  //  f.close();
}

void myGlobalShortcuts::testShortcuts()
{
  //  cout << "you press hot key ! " << endl;
  //cout << "1" << endl;
  cout << "1";
  fflush(stdout);
}

void myGlobalShortcuts::test2()
{
  cout << "test ..." << endl;
}


int main(int argc, char *argv[])
{
  QApplication app(argc, argv);

  //set global shortcuts
  myGlobalShortcuts gs;

   
  return app.exec();
}

